package com.woniu.his.sms.client;

import com.woniu.his.result.Result;
import com.woniu.his.sms.client.param.*;
import com.woniu.his.sms.client.result.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @version: java version 1.8
 * @Author: Mr tao 排班管理
 * @description:
 * @date: 2022-11-26 11:31
 */
@FeignClient(contextId = "smsSkdClient", name = "sms", path = "sms")
public interface SmsSkdClient {

    /**
     * 新增排班规则
     *
     * @return
     */
    @PostMapping("/createRule")
    public Result createRule(@RequestBody SkdRuleParam skdRuleParam);

    /**
     * 删除排班规则
     *
     * @param ids
     * @return
     */
    @DeleteMapping("/deleteRule")
    public Result deleteRule(@RequestParam("ids") List<Long> ids);


    /**
     * 更新排班规则表
     *
     * @return
     */
    @PutMapping("/updateRule")
    public Result updateRule(@RequestBody SkdRuleParam skdRuleParam);

    /**
     * 根据部门id筛选排版规则基本信息、分页
     *
     * @return
     */
    @PostMapping("/queryPageRule")
    public Result<SkdRulePageResult> queryPageRule(@RequestBody SkdRulePageParam param);

    /**
     * 根据规则id查询一条规则详情
     *
     * @return
     */
    @GetMapping("/queryRuleDetail")
    public Result<SkuRuleResult> queryRuleDetail(@RequestParam("skdRuleId") Long skdRuleId);

    /**
     * 根据多条排班规则生成skd
     *
     * @return
     */
    @PostMapping("/generateSkd")
    public Result generateSkd(@RequestBody CreateSkdParam param);

    /**
     * 分页查询排班记录
     *
     * @return
     */
    @PostMapping("/queryPageSkd")
    public Result<SkdSkuPageResult> queryPageSkd(@RequestBody SkuSkdPageParam skuSkdPageParam);

    /**
     * 查询排班记录 不分页
     *
     * @return
     */
    @PostMapping("/querySkd")
    public Result<List<SmsSkdResult>> querySkd(@RequestBody SkuSkdParam skuSkdParam);

    /**
     * 新增的时候列出员工信息
     *
     * @return
     */
    @GetMapping("/listCanSkdStaff")
    public Result<List<SmsSkdRuleItemResult>> listCanSkdStaff(@RequestParam("skRuleId") Long skRuleId);

    /**
     * 检查SKD是否存在
     *
     * @param skdId 通用id
     * @return {@link Result}
     */
    @GetMapping("checkSkdIsExist")
    public Result<SkdResult> checkSkdIsExist(@RequestParam("skdId") Long skdId);

    /**
     * @Description: 根据排班id, 获取排班信息
     * @Param:
     * @return:
     * @Date: 2022/11/29
     */
    @GetMapping("/findSkdInfoById")
    public Result<SkdInfoResult> findSkdInfoById(@RequestParam("skdId") Long skdId);


    /**
     * 挂号扣减挂号数量
     *
     * @param id
     * @return
     */
    @PutMapping("/deductions")
    public Result deductions(@RequestParam("skdId") Long id);

}
